﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<DIS_WEB_Client.ViewModels.GroupViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent2" runat="server">
<script type="text/javascript">
    function ValidateRegister() {
        var fullname = document.getElementsByName("fullname").item(0);
        if (fullname.value == "") {
            alert("Please input fullname");
            return false;
        }
        var phone = document.getElementsByName("phone").item(0);
        if (phone.value == "") {
            alert("Please input phone");
            return false;
        }
        var address = document.getElementsByName("address").item(0);
        if (address.value == "") {
            alert("Please input address");
            return false;
        }
        var email = document.getElementsByName("email").item(0);
        if (email.value == "") {
            alert("Please input email");
            return false;
        }
        var username = document.getElementsByName("username").item(0);
        if (username.value == "") {
            alert("Please input username");
            return false;
        }
        var password = document.getElementsByName("password").item(0);
        if (password.value == "") {
            alert("Please input password");
            return false;
        }
        var confirmpassword = document.getElementsByName("confirmpassword").item(0);
        if (confirmpassword.value == "") {
            alert("Please input confirmpassword");
            return false;
        }
        if (password.value != confirmpassword.value) {
            alert("Input password and confirmpassword is not match");
            return false;
        }
        return true;
    }
</script>
<%
    var fullname = ViewData["fullname"] == null ? string.Empty : ViewData["fullname"];
    var phone = ViewData["phone"] == null ? string.Empty : ViewData["phone"];
    var email = ViewData["email"] == null ? string.Empty : ViewData["email"];
    var address = ViewData["address"] == null ? string.Empty : ViewData["address"];
    var username = ViewData["username"] == null ? string.Empty : ViewData["username"];
    var password = ViewData["password"] == null ? string.Empty : ViewData["password"];
    var confirmpassword = ViewData["confirmpassword"] == null ? string.Empty : ViewData["confirmpassword"];
 %>
<table width="560" border="0" cellspacing="0" cellpadding="0">
    <tbody>
        <tr>
        <td valign="top">
        <!-- MAIN -->

            <div class="page_title" style="width: 556px">
                <div class="text">
                    New Account
                </div>
            </div>

            <div style="margin-left: 10px; margin-right: 10px; text-align:left"><br>
		        The fields marked <b>*</b> must be filled in.<br>		
		        <br>
            </div>
            <% using (Html.BeginForm("Register", "Home", FormMethod.Post, new { onsubmit = "return ValidateRegister();" }))
               { %>
			<table width="100%" border="0" cellpadding="0" cellspacing="0" style="text-align:left">
			    <tbody>
			        <tr bgcolor="#f6fbfd">
				        <td valign="top"><div style="margin: 5px 10px;"><b>Full Name *</b></div></td>
				        <td valign="top">
                            <div style="margin: 5px 10px 5px 5px;">
                                <%= Html.TextBox("fullname", fullname, new { @style = "width: 300px;" })%>
                            </div>
                        </td>
			        </tr>
			        <tr>
				        <td valign="top"><div style="margin: 5px 10px;"><b>Phone *</b></div></td>
				        <td valign="top">
                            <div style="margin: 5px 10px 5px 5px;">
                                <%= Html.TextBox("phone", phone, new { @style = "width: 300px;" })%>
                            </div>
                        </td>
			        </tr>
			        <tr bgcolor="#f6fbfd">
				        <td valign="top"><div style="margin: 5px 5px 5px 10px;"><b>Address *</b></div></td>
				        <td valign="top">
                            <div style="margin: 5px 10px 5px 5px;">
                                <%= Html.TextBox("address", address, new { @style = "width: 300px;" })%>
                            </div>
                        </td>
			        </tr>
			        <tr>
				        <td valign="top"><div style="margin: 5px 5px 5px 10px;"><b>Email *</b></div></td>
				        <td valign="top">
                            <div style="margin: 5px 10px 5px 5px;">
                                <%= Html.TextBox("email", email, new { @style = "width: 300px;" })%>
                            </div>
                        </td>
			        </tr> 
                    <tr><td colspan="2">&nbsp;</td></tr>
			        <tr bgcolor="#e8ecee"><td colspan="2"><div style="margin: 5px 5px 5px 10px;"><b>Username &amp; Password</b></div></td></tr>
			        <tr>
				        <td valign="top" colspan="2"><div style="margin: 5px 10px 5px 10px;"><font size="1">Please select a username and password for future logins. Retype your password in the Verify field to ensure it is correct.</font></div></td>
			        </tr>
			        <tr bgcolor="#f6fbfd">
				        <td valign="top"><div style="margin: 5px 5px 5px 10px;"><b>Username *</b></div></td>
				        <td valign="top">
                            <div style="margin: 5px 10px 5px 5px;">
                                <%= Html.TextBox("username", username, new { @style = "width: 200px;" })%>
                            </div>
                        </td>
			        </tr>
			        <tr>
				        <td valign="top"><div style="margin: 5px 5px 5px 10px;"><b>Password *</b></div></td>
				        <td valign="top">
                            <div style="margin: 5px 10px 5px 5px;">
                                <%= Html.Password("password", password, new { @style = "width: 200px;" })%>
                            </div>
                        </td>
			        </tr>
			        <tr bgcolor="#f6fbfd">
				        <td valign="top"><div style="margin: 5px 5px 5px 10px;"><b>Verify Password *</b></div></td>
				        <td valign="top">
                            <div style="margin: 5px 10px 5px 5px;">
                                <%= Html.Password("confirmpassword", confirmpassword, new { @style = "width: 200px;" })%>
                            </div>
                        </td>
			        </tr> 
                    <tr>
						<td height="20" style="width: 130px">
						</td>
						<td height="20">
							<div style="margin: 5px 10px 5px 5px;">
								<br/>
                                <input type="submit" name="sbt" id="sbt" value="Register" style="background-image: url(../../../Content/Images/bgbutton.jpg); color: #FFFFFF; font-size: 16px; font-weight: bold; border: 1px #DBDBDB solid; height: 30px; cursor:pointer;" />
								<p>
								</p>
							</div>
						</td>
					</tr>
                </tbody>
			    <!-- MAIN END -->
            </table>
        <% } %>
	</td></tr>
	</tbody>
</table>
</asp:Content>
